const Mock = require('mockjs')


const customerList = []

for (let i = 0; i < 20; i++) {
  customerList.push(Mock.mock({
    id: '@increment',
    area_code: (340102001000+i+1).toString(),
    area_name:'安徽省/合肥市/蜀山区/梦圆小区/'+i+1+'栋',
    area_path:["340000","340100","340104","340104001","340104001001"],
    customer_name:'@first',
    customer_type:'居民',
    room_number:"801",
    identity_card:'34010200100000123',
    identity_type:'身份证',
    mobile:'15056928426',
    establish_time:+Mock.Random.date('T')
  }))
}

module.exports = [
  {
    url: '/customer/list',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: {
          list:customerList,
          total:customerList.length
        }
      }
    }
  },
  {
    url: '/customer/delete',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  },
  {
    url: '/customer/add',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  },
  {
    url: '/customer/update',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  }
]

